<template>
	<view class="Lu-ordInf-page">
		<view class="clearfix Lu-ordInf-header">
			<text class="iconfont icon-fanhui fl Lu-ordInf-icon" @click="navback()"></text>
			<view class="fl Lu-ordInf-tit">订单详情</view>
		</view>
		<view class="Lu-ordInf-body">
			<view class="Lu-ordInf-school clearfix">
				<text class="iconfont icon-inforrder Lu-ordInf-schoolicon fl"></text>
				<view class="Lu-ordInf-schoolname fl">
					{{orderinfor.agent_name}}
					<text class="iconfont icon-gengduo Lu-ordInf-schoolgengduo"></text>
				</view>
				<text class="Lu-ordInf-yifu fr" v-if="orderinfor.order_info.pay_status">已付款</text>
				<text class="Lu-ordInf-yifu fr" v-else>未付款</text>
			</view>
			<view class="Lu-ordInf-center clearfix">
				<view class="Lu-ordInf-schoolimg fl">
					<image src="../../static/image/order/222.png"></image>
				</view>
				<view class="Lu-ordInf-schoolinfor fl">
					<view class="Lu-ordInf-schoolinfor01">{{orderinfor.course_class_address}}</view>
					<view class="Lu-ordInf-schoolinfor02">{{orderinfor.course_name}}</view>
					<view class="Lu-ordInf-schoolinfor03">支付方式: 微信支付</view>
				</view>
				<view class="Lu-ordInf-schoolprice fr">
					￥{{orderinfor.course_platform_price}}
				</view>
			</view>
			<view class="Lu-ordInf-centerfoot">
				<view>已付款</view>
				<view>￥{{orderinfor.order_info.order_pay_price}}</view>
			</view>
		</view>
		<view class="Lu-ordInf-footer">
			<view class="Lu-ordInf-footertit">
				订单信息
			</view>
			<view class="Lu-ordInf-footerinfor">
				用户ID: {{orderinfor.order_info.user_id}}
			</view>
			<view class="Lu-ordInf-footerinfor clearfix">
				订单编号: {{orderinfor.order_info.order_num}}
				<text class="item-btn fr" @click="paste(orderinfor.order_info.order_num)">复制</text>
			</view>
			<view class="Lu-ordInf-footerinfor">
				订单金额: {{orderinfor.course_platform_price}}
			</view>
			<view class="Lu-ordInf-footerinfor">
				课程名称: {{orderinfor.course_name}}
			</view>
			<view class="Lu-ordInf-footerinfor">
				<text v-if="orderinfor.order_info.pay_status">支付状态: 已支付</text>
				<text v-else>支付状态: 未支付</text>
			</view>
			<view class="Lu-ordInf-footerinfor">
				支付方式: 微信支付
			</view>
			<view class="Lu-ordInf-footerinfor">
				支付时间: {{orderinfor.order_info.pay_time}}
			</view>
			<view class="Lu-ordInf-footerinfor">
				创建时间: {{orderinfor.order_info.create_time}}
			</view>
			<view class="Lu-ordInf-shangjiafoot">
				<view class="Lu-ordInf-shangjiasj">
					<text class="iconfont icon-shangjiaicon Lu-ordInf-sjicon"></text>
					<text class="Lu-ordInf-sjtit">联系商家</text>
				</view>
				<view class="Lu-ordinfsx"></view>
				<view class="Lu-ordInf-shangjiaphone">
					<text class="iconfont icon-shangjiaphone Lu-ordInf-phoicon"></text>
					<text class="Lu-ordInf-phonetit" @click="gophone(phone)">拨打电话</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
	export default {
		computed: {
			...mapState(['hasLogin','userInfo','openId','apiUrl','pid'])
		},
		data() {
			return {
				orderinfor:'',
				order_id:'',
				phone:''
			}
		},
		onLoad: function(option) {
			this.order_id= option.id;
		},
		onShow() {
			uni.request({
				url:this.apiUrl+'api/get_order',
				method:"POST",
				header:{
					openid:this.openId
				},
				data:{
					order_id:this.order_id,
				},
				success: (res) => {
					this.orderinfor = res.data.data
					const _this = this
					uni.request({
						url:_this.apiUrl+'api/get_agent_info',
						method:"POST",
						header:{
							openid:_this.openId
						},
						data:{
							agent_id:res.data.data.id,
						},
						success: (res) => {
							_this.phone = res.data.data.phone
						}
					})
				}
			})
		},
		methods:{
			gophone:function(phone){
				uni.makePhoneCall({
				 	
				 	// 手机号
				    phoneNumber: phone, 
				
					// 成功回调
					success: (res) => {
						console.log('调用成功!')	
					},
				
					// 失败回调
					fail: (res) => {
						console.log('调用失败!')
					}
					
				  });
			},
			paste(value) {
				uni.setClipboardData({
					data: value
				});
			},
			navback(){
				uni.navigateBack({
					delta:1
				})
			},
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #f5f5f5;
		
	}
	.Lu-ordInf-page{
		padding: 80rpx;
	}
	.Lu-ordInf-header{
		margin-left: 10rpx;
		height: 40rpx;
		line-height: 40rpx;
		.Lu-ordInf-icon{
			font-size: 32rpx;
			color: #333333;
		}
		.Lu-ordInf-tit{
			font-size: 32rpx;
			margin-left: 18rpx;
			color: #333333;
		}
	}
	.Lu-ordInf-body{
		padding: 26rpx 36rpx;
		background-color: #ffffff;
		margin-top: 30rpx;
		border-radius: 40rpx;
		.Lu-ordInf-school{
			// display: flex;
			// align-items: center;
			height: 50rpx;
			line-height: 50rpx;
			.Lu-ordInf-schoolicon{
				font-size: 30rpx;
				color: #ff9800;
			}
			.Lu-ordInf-schoolname{
				margin-left: 40rpx;
				font-size: 32rpx;
				color: #333333;
				.Lu-ordInf-schoolgengduo{
					font-size: 24rpx;
					color: #999999;
					margin-left: 22rpx;
				}
			}
			.Lu-ordInf-yifu{
				font-size: 24rpx;
				color: #999999;
			}
		}
		.Lu-ordInf-center{
			margin-top: 56rpx;
			.Lu-ordInf-schoolimg{
				width: 102rpx;
				height: 102rpx;
				border-radius: 10rpx;
				image{
					width: 102rpx;
					height: 102rpx;
				}
			}
			.Lu-ordInf-schoolinfor{
				margin-left: 46rpx;
				.Lu-ordInf-schoolinfor01{
					font-size: 24rpx;
					color: #333333;
				}
				.Lu-ordInf-schoolinfor02{
					margin-top: 16rpx;
					font-size: 24rpx;
					color: #999999;
				}
				.Lu-ordInf-schoolinfor03{
					margin-top: 12rpx;
					height: 36rpx;
					width: 250rpx;
					border-radius: 10rpx;
					// padding: 0rpx 8rpx;
					font-size: 24rpx;
					line-height: 36rpx;
					text-align: center;
					color: #44f57a;
					background-color: #f8fff7;
				}
			}
			.Lu-ordInf-schoolprice{
				font-size: 30rpx;
				color: #333333;
			}
		}
		.Lu-ordInf-centerfoot{
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 60rpx;
			font-size: 30rpx;
			color: #333333;
		}
	}
	.Lu-ordInf-footer{
		background-color: #fff;
		margin-top: 20rpx;
		border-radius: 40rpx;
		padding: 26rpx 36rpx;
		.Lu-ordInf-footertit{
			font-size: 26rpx;
			font-weight: 600;
			border-bottom: 2rpx solid #e5e5e5;
			padding-bottom: 22rpx;
			color: #333333;
		}
		.Lu-ordInf-footerinfor{
			margin: 24rpx 0;
			font-size: 24rpx;
			color: #666666;
		}
		.item-btn{
			font-size: 26rpx;
			color: #44a3f5;
		}
		.Lu-ordInf-shangjiafoot{
			margin-top: 24rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			.Lu-ordInf-shangjiasj{
				.Lu-ordInf-sjicon{
					color: #1296db;
					font-size: 30rpx;
				}
				.Lu-ordInf-sjtit{
					font-size: 28rpx;
					color: #666666;
					margin-left: 20rpx;
				}
			}
			.Lu-ordinfsx{
				width: 2rpx;
				height: 32rpx;
				background-color: #e5e5e5;
				margin: 0 100rpx;
			}
			.Lu-ordInf-shangjiaphone{
				.Lu-ordInf-phoicon{
					color: #1296db;
					font-size: 30rpx;
				}
				.Lu-ordInf-phonetit{
					font-size: 28rpx;
					color: #666666;
					margin-left: 20rpx;
				}
			}
		}
	}
</style>
